simpler check on index in get