wait for progress dialog to close before opening other dialogs