dashboard should be in lib
added code to reconnect

mainly for dashboard use