Added try-catch for ext().