add listeners to plugin state changes