Fix the annoying restart bug