fixed a bug in controllers.js with pub/sub