Fixed crash on migraion