bugfix in plotting routine