add try and catch