your last else will never activate as you have a misplaced \"}\" immediately before it. Also one too many \"}\" after the last else.