added call_back function for graph