fixes for migration script