Adds try except

All tests pass