Change lambdas to use env at time of definition