Added better garbage collection