Added more logic to check when we hit the lowest level of filtering.