added on/off switch for real time grapg generation