bug fix: lock must stay locked during publish