#3453 fixed togglePublish function