Updated to handle ObjectNotConnected error.