util: fixed segfault by distinguishing functions.