fixed indentation, moved signalShouldStop = 0