copying index to main