attempt to solve Bug #1009 by not building graph every frame