add a simple restore logic, but not tested (for backup)