update script to plugin