fixed graph being updated twice