fix lottery bugs