check return for write