Fixed infinite loop if a ticket does not print