add try/except around external call