fixed the try catch