ensure array not empty