Fixed endless restart bug