fix bug in deque and tree