fix restart bug