fixed bug in migration