improve batch write