fixed index error in nnet