fix bug in migration