wrap env into IORef