implemented auto-refresh of graph