trying to make onstatechange work with the plugin in the options.