add smooth publish code