aded changes for index searching