Fix dialog bug