fixed a plotting bug