Currently implemented function calls based on the output script implies that the function call will never return(stacking up the stack call) until it reaches to the end of the call.
Consider calling them as Lambda function or make them to return if some certain node processes are done.