added additional sanity check to index call