fixing garbage collection