                     let fileContent = inString.components(separatedBy: .newlines)
 
                     for line in fileContent {
-                        let element = line.components(separatedBy: ";")
-
-                        if element.count >= 3 {
-                            print(element)
-                            let unixTimestamp = Int(element[0])!
-                            let fullUrl = element[1]
-                            let jsonBody = element[2]
-
-                            addRequest(timeStamp: unixTimestamp, fullUrl: fullUrl, json: jsonBody)
+                        let elements = line.components(separatedBy: kDelimiter)
+
+                        if elements.count >= 3 {
+                            let unixTimestampAsInt: String = elements[0]
+                            let unixTimestamp = Int(unixTimestampAsInt)
+                            let fullUrl = elements[1]
+                            let jsonBody = elements[2]
+
+                            addRequest(timeStamp: unixTimestamp!, fullUrl: fullUrl, json: jsonBody)
                         }
                     }
                 } catch {

        return numberOfRequests
    }

    public func shutdown() {
        safeMissedRequests()
    }

    public func safeMissedRequests() {
        if self.missedRequests.count > 0 {

            let fileURL = try! FileManager.default.url(for: .documentDirectory,
                            in: .userDomainMask, appropriateFor: nil, create: false)
                    .appendingPathComponent("BreinifyMissedRequests.txt")

            if let outputStream = OutputStream(url: fileURL, append: true) {
                outputStream.open()

                var output = ""
                for jsonElement in self.missedRequests {
                    output = output
                            + "\(jsonElement.creationTime)"
                            + ";"
                            + jsonElement.fullUrl
                            + ";"
                            + jsonElement.jsonBody
                            + "\n"
                }
                let bytesWritten = outputStream.write(output,
                        maxLength: output.lengthOfBytes(using: .utf8))
                if bytesWritten < 0 {
                    print("write failure")
                }
                outputStream.close()
            } else {
                print("Unable to open file")
            }
        }
    }

    public func loadMissedRequests() {

        if self.missedRequests.count == 0 {

            let fileName = "BreinifyMissedRequests"
            let docDirectory = try? FileManager.default.url(for: .documentDirectory, in: .userDomainMask,
                    appropriateFor: nil, create: true)


        updateTimer?.invalidate()
        updateTimer = nil
    }

    // dictionary of UUID to jsonRequest (unixTimestamp, fullUrl, jsonString)
    var missedRequests = [String: JsonRequest]()

    // contains the unixTimestamp when the failure was detected
    var failureTime = 0.0

    // contains the expiration Duration (5 minutes in seconds)
    var expirationDuration = 5 * 60 * 60

    /// instance for processing unsent requests
    var updateTimer: Timer?

    /// contains the background interval
    var interval = 60.0

    /// contains the delimiter between each element of the structure
    let kDelimiter = "°"

    /// contains the filename for saved requests
    let kRequestFileName = "BreinifyMissedRequests"

    /// contains the full filename for save requests
    let kRequestFullFileName = "BreinifyMissedRequests.txt"

    public func configure() {
        updateTimer = Timer.scheduledTimer(timeInterval: interval,
