better disconnect and failure handling

posts some notifications on errors
tries to reconnect every five seconds