the isRunning field should be marked volatile