Fix pubsub implementation. Add plugins option needToRun