added more argument checks to publish interface