Unable to use try/except ValueError