bugs in migr script