added extra condition on qsearch prune