added validation on login