same for write.