Fixed bug in publish plugin