added exceptional to send email on 500 errors