Fixes restart bug