access curIndex with window. always