Ticket cancelling function