fix auto restart bug, add samples