PLOT: fixed an index out of bounds - bug