fix lottery_count bug in lottery module