using if let style of variable checking for a part I missed