Lock should be outside of the try/finally block.