lock instance bug fix