this setTimeout for addGraph is kinda crap but at least it works