fix weird migration bugs.