Fix lock not unlock bug.