Adding resolve_ticket() function