fixed a bug in publish