Bugfix: index mapping function
function next set index