fix sorting issue
fix total count