Changed out the try exception to for loop