finally fixed

not sure if this is exactly how it needs to be done, but I think this
logic is fine. Just do the try catch outside of everything, and then do
the rest? makes sense to me i think