yes, the dialog window has two button one is 'Done' button and the other is  'Cancel' button. I want this function to execute onlly when the 'Done' button is clicked. I think the var name is misleading so i renamed it to 'checkDoneButtonClicked'