fix a problem when close dialog