Working version of publish command