added callback for connect to handle connection errors easier
Merge pull request #1 from d3media/master

Adding Callback for connect