add try-catch-blocks