fixed errors with createTicket function