Added missing "then" in "if" statement