create messages variable at top and reuse that

So at top:

```JavaScript
var myHub = $.connection.hubClientsAPIs,
    messages = $("#messages");
```