fixed race, the event pipe should now reflect the status of input, keep track on queue length