fixed a garbage collection issue