adjust migration funcion