write data and delete link