Fixed bug in publish script