Enhanced the stream reading