fix errors & warning