fix multiple graphs bug