Fixed bug in Dialog

Fixed bug in Dialog