Fixed bug in data queue logic.