fix progress calculation