fix some functions