added curl check if index exist