fix for destroying dialog which is destroyed already