fixed restart bug.