bugfixes and skeleton for publish