properly handle wrong arguments for publish

fixes #1