v0.1.2 added error handling and automatic reconnect