5 Fix migrate functions