fixed progress_bar() to work under Matlab