fixed fix function, if index_old exists then remove it