better handling of input queue