fixed error in stream constructor code