progressbar logic updated