change process index and maxindex to ints.