fixed bug in publish