an evil hack to mulitplex io streams