fix broken if comparison