add garbage collection like in Gloss