revert call function implement and fix bug test
change if cond
implement call function in if context
implement loopvars