attempt at better try except blocks