Fix migrate bug