Fixing the migration code