Improve validation on login