fix a possible issue with the gc collecting valid values