fix the problem where if there is only one expression in the function
definition, its variables will not be replaced