move outIndex on client side JS to work with script -c ssh