An error...

As soon as i add this, it fails.

We're only going to tell you about 14 more times. You absolutely MUST have EXACTLY ONE { for every }. That last block of code has 9 curly braces - some open, some close. It must have an even number. Period. You can try anything you like but you can NOT get around that fact.