fixed migration bugs