javascript variables working, especially numbers, however needs validations