fixed bugs in migration manager