Add trigger_close function in Dialog class