Do some corrections in showing dialog