Corrected problem with EmptyQueueException