fixed variable names in email_wrapper