works , fix the index later