used custom_index instead of built in function