Logic fix for conditional check.