use isempty in findidx instead of 0 length