fix the email error is not printed