function "write" done.