I think I found the problem but don't know how to resolve it.
My order subtotal before tax is 41.14. I have discount of 10% which gives total 36.93 before tax. After tax price is 42.90.
I have set the rule when order subtotal is 40euros shipping is free. It seems that subtotal does not take into account the tax. so the subtotal is 36.93 before the tax and the free shipping is not applied.
How to fix this?