fixed queue.c bugs