Fixed error when migrating