Why progress bar widget is not advancing properly?