check return for write.