Why my form calculations are not working properly?