fixing creatiion of indices