fix bug for migrate