fix some problem in util.c