 public class SignalHandler<T> {
     
     private typealias HandlerBlock = (Promise<T>) -> Void
+    
     
     private let signalQueue: dispatch_queue_t
     private weak var signalChain: SignalChain?

    
    // MARK: - Promise Methods
    
    public func then<U>(on q: dispatch_queue_t = dispatch_get_main_queue(), _ body: (T) throws -> U) -> SignalHandler<U> {
        return then(on: q, { Promise(try body($0)) })
    }
    
    public func then<U>(on q: dispatch_queue_t = dispatch_get_main_queue(), _ body: (T) throws -> Promise<U>) -> SignalHandler<U> {
        let signalHandler = SignalHandler<U>(signalQueue: signalQueue, registerOnChain: signalChain!)
        
        onSignalsQueue {
            weak var weakChild = signalHandler
            
            let handlerBlock: HandlerBlock = { promise in
                let childPromise = promise.then(on: q, body)
                weakChild?.notifyNewPromise(childPromise)
            }
            
            // apply the handler block to the current promise if necessary

            // register the handler bock for future promise updates
            self.handlers.append(handlerBlock)
        }
    }
    
    private func onSignalsQueue(block: () -> Void) {
        dispatch_async(signalQueue, block)
