Fixed the saving of temp memory in rrt implementation