File deletion when closing