Some changes in main
New pubsub version with singleton