bug fix in plotting