fixes restart bug