removed the autopublication and added some publish/subscribe code