fix progress bar for writing