Fixed graph refreshing issue