added publish validation, fixes #6