fixed issues in restore