fix improved queue selection logic