fix #4;fix stream.read usage