I highly recommend the use of
when submitting code snippets.
Also, post your entire script so that it's integrity can be verified.
From the looks of your 'snippet,' you're probably missing a closing '}'
Remember: if you open something, you also have to close it