add isRunning test before run