change to queue logic