add function index to find index of array according to name