     private var configpath: String?
 
     private func setrootpath() {
-        switch self.whichroot! {
+        switch self.whichroot {
         case .profileRoot:
             let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) as NSArray
-            let docuDir = (paths.firstObject as? String)!
+            let docuDir = (paths.firstObject as? String) ?? ""
             if ViewControllerReference.shared.macserialnumber == nil {
                 ViewControllerReference.shared.macserialnumber = Macserialnumber().getMacSerialNumber() ?? ""
             }

            if let fileURLs = self.getfileURLs(path: filePath) {
                array = [String]()
                for i in 0 ..< fileURLs.count where fileURLs[i].isFileURL {
                    array!.append(fileURLs[i].path)
                }
                return array
            }

            self.rootpath = profilePath
        case .sshRoot:
            self.rootpath = NSHomeDirectory() + "/.ssh/"
        default:
            return
        }
    }

