updated stream-input handling