refine migrate bugfix