added the check for the email as well