Added braces to fix increment issue