fixed an issue with which values are kept in the heap