Revised try-catch