added beforePlugins method