introduce reference counting within temporary files