tree delete memory error