added validation for logging in.