replace length(x) > 0 by length(x)