Also check that ticket is not undefined