Fixed first dialog window closing