Removed outer if and put the condition inside (cond).