fixed restart bug