bug fixed.
add support for Substituting bound variable with generated functions.