Added callback for on close