fixed logic errog in migration order