Fixed closure bug in restore