added email error check