JavaScript changes for graph fix