     public var alamofireManager: Manager!
     public var timeoutInterval: NSTimeInterval = 30 {
         didSet {
-            let configuration = NSURLSessionConfiguration.defaultSessionConfiguration()
-            configuration.timeoutIntervalForRequest = self.timeoutInterval
-            self.alamofireManager = Alamofire.Manager(configuration: configuration)
+            alamofireManager = Alamofire.Manager(configuration: HttpRequest.configurationWithTimeoutInterval(timeoutInterval))
         }
     }
     

        struct Singleton {
            static let instance = HttpRequest()
        }
        Singleton.instance.alamofireManager = Manager.sharedInstance
        return Singleton.instance
    }
    

        return requestHeaders
    }
    
    class func configurationWithTimeoutInterval(timeoutInterval: NSTimeInterval) -> NSURLSessionConfiguration {
        let configuration = NSURLSessionConfiguration.defaultSessionConfiguration()
        configuration.timeoutIntervalForRequest = timeoutInterval
        return configuration
    }
    
}

extension Request {
    
    public func timeout(requestTimeoutHandler: (url: NSURL?) -> Void) -> Self {
        return response { (request, response, data, error) -> Void in
            if let error = error where error.domain == "NSURLErrorDomain" && error.code == -1001 {
                var url: NSURL?
                if let failingURLString = error.userInfo["NSErrorFailingURLStringKey"] as? String {
                    url = NSURL(string: failingURLString)
                }
                requestTimeoutHandler(url: url)
            }
        }
        return self
