add some fixes to email callback