several bugfixes plus emitting data to the redis pub/sub