Bug fixing. Added missed curly braces