modified updateKey method in TreeObject.java