cleanup for plugin.js