restoring main