Added update function to plugin.