fix possible dialog dismiss error