added search and made main query keys only