fixing lock problem