Added callback functions for close and confirm