[UPD] Bug in restore function