adding x_migrate flag and changing reference to text for defensive input munging