making progress bar work