publish draft function updated