added repetition check in qsearch