rewrites exportEnv with the do notation