fix graph performance bug