The progress dialog works properly now.