changed is_array to ! empty for facets validity check, because it wasnt working