Update env.rb to transaction