                     var frameIndex = 0
                     var nextFrame = {}
                     nextFrame = {
-                        after(sendFramesRepeatInterval, {
+                        after(sendFramesRepeatInterval) {
                             guard frameIndex < sendFramesCount else {
                                 controller.disconnect()
                                 expectation.fulfill()

            controller.connect()
        })
        discovery.startDiscovery()
        waitForExpectationsWithTimeout(30.0, handler: {_ in discovery.stopDiscovery() })
    }

    func testNuimoControllerSkipsLEDAnimationFramesIfFramesAreSentTooFast() {

                            frameIndex += 1
                            controller.writeMatrix(NuimoLEDMatrix(string: String(count: frameIndex % 81, repeatedValue: Character("*"))), interval: 2.0)
                            nextFrame()
                        }
                    }
                    nextFrame()
                },
