throw exception in device class if not connected