Add some error handling re: disconnecting.