fixed bug with the garbage collection hopefully