Changed to add try catch