Restore logic added