fixed a bug in output queue
fixed a shutdown/deallocation error