pass the environment to the plugin constructor