fixed migration functions