[tb][fx] fix recursive function