Fixed bug in migration