fix uncaughtexception thrown by progressdialog.dismiss() method