curly braces missing here (and in more if / else clauses throughout the file)