fix some function error