fixed plotting bug