fix if expression bug in function and method.