updated search method