small import code fix (better error handling)