fix some function