added support for io stream