simplified test
fixed a logic bug in the data stream handling