Fixing security groups in upgrade script