collect garbage on browser close