rewrote com port polling with select