fixing lock bug