fix total_count going to 0