use ReadAll instead of Read, handle read errors