also export the environment, and run the right function