Add some function and repair