Added isConnected method
Not always going to be necessary but you may find yourself in a position
where you want to check this.