improved popular tags query to order correctly