Mistyped then, corrected the 2 if statements affected