fix plugin with multiple states