fixing bug in migration