changed processAddInputStream and processAddOutputstream to work with pstream pointers instead of IDs