fix bug in migrate file