preparation for total_count