fixed disconnecting

fixed it so it will reconnect if the broker disappears.