Fixed bug in migrat