fixed bug in try/except