Add a delay of 100 ms before adding the source to the document, to make sure the progress bar is updated.