More robust search functionality