for user query logic