get length of selection