fix a bug in queue.c