Fixed locking error.