         if !isMapAppInstalled(mapApp) {
             return false
         }
-        var url: String!
+        var urlString = ""
         switch(mapApp) {
         case .apple:
-            url = NSString(format: "http://maps.apple.com/?saddr=%@&daddr=%@&z=14",
+            urlString = NSString(format: "http://maps.apple.com/?saddr=%@&daddr=%@&z=14",
                            googleMapsString(fromDirections),
                            googleMapsString(toDirection)) as String
         case .here:
             if #available(iOS 9.0, *) {
-                url = NSString(format: "https://share.here.com/r/%f,%f,%@/%f,%f,%@",
+                urlString = NSString(format: "https://share.here.com/r/%f,%f,%@/%f,%f,%@",
                                fromDirections.location.coordinate.latitude,
                                fromDirections.location.coordinate.longitude,
                                fromDirections.name,

        }
        
        let urlPrefix: String = urlPrefixForMapApp(mapApp)
        return application.canOpenURL(URL(string: urlPrefix)!)
    }

    /**

                                    toDirection.location.coordinate.latitude,
                                    toDirection.location.coordinate.longitude))
            }
            urlString = NSString(format: "transit://directions?%@", params.componentsJoined(by: "&")) as String
        case .waze:
            urlString = NSString(format: "waze://?ll=%f,%f&navigate=yes",
                           toDirection.location.coordinate.latitude,
                           toDirection.location.coordinate.longitude) as String
        case .moovit:
            urlString = NSString(format: "moovit://directions?dest_lat=%f&dest_lon=%f&dest_name%@=&orig_lat=%f&orig_lon=%f&orig_name=%@&auto_run=true&partner_id=%@",
                           toDirection.location.coordinate.latitude,
                           toDirection.location.coordinate.longitude,
                           urlEncode(toDirection.name as NSString),
