fix syntax errors and migration file