added error handler in pubsub for propagating events