When you add the }, what are your errors?
The reason why you see different (more, but could have been less) errors when you add the } is because the IDE you are using can "see the greater picture"...