fix crash on emailing error