fixed validation for register and login