Added function to terminate progress bar operations