Fixed problem where I was checking number of elements in delayedQueue object incorrectly.