add distinct to user input query