Added validation to register and login pages