working on dialog functionality