small changes for serial connection reading