Fix restart bug