added some logger output in the email handler