fix Proc.read() and Proc.write()