improved query for upvoting