for top user query logic