fix errors and syntax