added validation for login