How do you know the process is finished.
It might be the reason that your application has been hit with the error and in that case the progress bar will be continously moving unless you continue the execution of code. And after the execution you will see error on browser.
I have face this issue while implementing this code.
Please check you code properly. The article is correct and working.
Glad to assist!