Mod the next_entry by the total so no overflow