working on handling dialog events