Added error handling if the items requested is less than the number of words found.