fixed calculation error in progressbar