Add method to provide code to run after dialog has closed