Fix email issue with promises