Adding checks to make sure empty fields are handled when indexing