Changed trash-collection to listen for an inventorycloseEvent.