checkEmail function complete