Add codes to check that dbus connection is valid