Fix dialog when close