fix lock release bug.