swapping the try except for a more reasonable if then