added email and password validation with error messages