adding functionality of finding local index