Why my form is not properly calculation based on user's selection?