added check for progress dialog