improved error handling for NULL pk values when importing data