Added try finally block.