fix bugs in output queue switch