migration: Only change state after migration has finished