fix the check email function