change window.plugin to window for initiating plugins