fixes for disconnects and reconnecting
error handling