fixed bug on dialog close