Added try/catch block.