should have been try/except, not if statement