Delegate connection for the Done and Cancel buttons