bugfix. migrate_mb. add many debug code...(cleanup later)