better find_occurrences handling