made the try catch block include more stuff