search with the right function