fix sort not works when max count reached
Merge branch 'master' into gh-pages
build