This fixes restart bug