fix logically and find a error about queue.