Change migrate function
Fix migrate function
Working migrate function