update server.c:modify function recreate_trajs