fix syntax errors in upgrade script