added validation for email and password