fix recursion termination via callback issue