fixing bug with node that was returning the invalid pointer for parent