Updating variable name to be consistent with other similar names. Fixing typo in if check.