added smarter dialog