update code for publish