added restore script functionality