fixed when-not branching