better error handling in import script