modifying search function