fix to restart bug