change io.Reader to io.ReadCloser