Migration: more robust error checking for missing fields
remove console.log