improve error logging and send emails to dedicated address