add lock implementation.