wait for add data written then close fd