Fix issue where the progres bar prevents the process from exiting as expected