Fixed publishing script bug