fix exception caused by accidently pushing the queue array back onto itself