Modified searchByName method