You should guard this close with a try/finally block.