reimplemented serial handler class

now reconnecting after connection loss should work