fix email not defined error