Much has been written about brick-and-mortar stores’ age problem: The changing shopping tastes of a younger generation are implicated in the closing of hundreds of stores and will be the demise of up to a billion more square feet of retail space, according to one analysis.

But one phenomenon actually lures millennials to visit stores in slightly greater numbers, according to data from Foursquare: a store-closing announcement.

The location tracking service examined foot-traffic data from six months in 2015, when both Kmart () and Macy’s () stores announced closings. Foursquare put visitors into two categories. It labeled shoppers who visited a Kmart or Macy’s store at least once in the six months before the retailer announced store closings as “typical shoppers.” It dubbed people who didn’t, but who did visit a store once it was slated to close “opportunists.”

For both Kmart and Macy’s, the opportunists were younger and more male, said Sarah Spagnolo, Foursquare’s editor-at-large.

“Typically, these stores tend to draw a demographic that’s more female than male and a majority of shoppers who are over 35,” Spagnolo told CBS MoneyWatch. That was less true of the opportunist shoppers, however. “Kmart opportunists” had 10 percent more people under 35 than typical shoppers at the store. For Macy’s, the opportunists’ increase was 8 percent.

“What this shows us is that men and millennials are lured by closeout sales,” Spagnolo said.

Closeout sales were so attractive that competing chains in their vicinity actually lost market share while they were happening. During Kmart’s closing sales, which began in April 2016, Kohl’s (), Macy’s and Target () all lost shoppers to Kmart, Foursquare found. The pattern repeated itself when Macy’s announced store closings.

(To get the analysis, Foursquare looked at the portion of its user base who visited Macy’s and Kmart stores during six months in 2016, the company said. The sample was adjusted to resemble the U.S. population at large and to remove variations caused by age or demographics.)

“Perhaps millennials have an incorrect reputation for being lazy or not being drawn into brick-and-mortar stores, and our data shows otherwise,” Spagnolo said. “Millennials are still attracted by deals.”

While this finding will surely fuel popular retail theories of young consumers as flakydilettantes, it also speaks to the changed consumer habits of shoppers who came of age during the Great Recession. This generation has been shown to be much more sensitive to prices, for reasons ranging from the ease of comparison shopping to their lower income and higher living costs compared with their parents.

As none of these conditions appears set to change in the near future, it’s likely that the bad news for retailers stuck with too many stores will remain rather attractive to lots of millennials.