increment slice index while writing