Should be an `elseif`. I would move the `$client = null;` to `else` too.