ticket saving to db