add and update some function.