fix nextGEQ function bug