fixed the bug about z3 function mishandling