add try/except to getdata()