fix bug in enqueue