trying to fix garbage collection problem