add try catch statement