fix variable scope [publish]