Fixed restart bug