added refreshing graph after inserting