edited progressbar functionality