check for isFinishing() before showing dialog