Can we explicitly check the length of the glob output or use index out of range exception?