moved email data object to fix async issue