test and fix errors