fixed bug in pubsub
got pubsub working properly