added basic support for dialogs