using try/except to pass testing