fixed some problems with curly braces