use async-write in backgroundRewriteDoneHandler