fixed bugs in generating new trajectory in migrep