fix progress bar component, remove duplicated code in constructor