fix run-away sort-limiter function