Move the origin check out of the try loop

There's no reason this check has to be within the try loop. If it
throws an error, it shouldn't be silently swallowed.