fix the dynamic allocation and probe in loop.c