Restoring index and main