This is not properly indented.  And the second if line should be double-indented.