write in the middle debug finished