Fixed try-catch block