better email handling