                 @emitted   = {}
                 Connector.connect = (opts) => 
                     on: (event, handler) => 
-                        handler @whenEvent[event] if @whenEvent[event]?
+                        if @whenEvent[event]?
+                            handler @whenEvent[event]
+                            @whenEvent[event] = handler # so it can be called again
                     emit: (event, args...) => 
                         @emitted[event] = args
 

                    done()


                it 'calls back with the accepted client', (done) -> 

                    Date.now = -> 1
                    @whenEvent['connect'] = true

                        stateAt: 1
                    done()

                it 'when connect.state is interrupted it sets the connection.state to resuming', (done) -> 

                    Date.now = -> 1
                    @whenEvent['connect'] = true
                    @whenEvent['accept'] = true
                    @whenEvent['disconnect'] = true

                    Client = client()
                    Client.create 'client name', @opts

                    @whenEvent['connect']()  # refire connect
                    connection = _client().clients['client name'].connection
                    connection.should.eql 
                        state: 'resuming'
                        stateAt: 1
                    done()



            context 'accept', -> 

                it 'when connect.state is connecting it sets connect.state to accepted', (done) -> 

                    Date.now = -> 1
                    @whenEvent['connect'] = true
