Fixed taking the correct datum out of the queue