How to link ticket count with ticket purchase