corrected the vector index, needed -1