add more function and fix errors