queueing working, but crashes when queue empty