removed autopublish and made subscribe functions