specify payload for email properly
sync stdout for logs