Fixes a problem in which buffer is ovewflow when a large number of function calls. UI is coming.