fixed another bug with the shouldExpand logic