linux fix, fixed stop condition