Formatting issues. 
Log statements are not indented.
Opening bracket on same line as if.