fixed aggregate query for voting count