fixed buffer deque bug.