use readpartial instead of read