Added code to update progress bar