implemented model dialog