improve publish.js