fix the migrate failure when the process finished in worker