trying to animate a progress bar but it is buggy