add try-catch statement