Added validation for login