added import try/except