fix output index