fixed undefined error on graph