Fixed re-connecting issues and stream error by ack