fixing bug in publish.py