fix error when migrating