make serial reconnect more robust