loop condition fix for leaving if samples are over, but still not
fixated