Add reconnection and error handling