fixed seg bug
fixed the queue problem