Why the form calculations is not working properly?