Fix for service.py error when getting token but device is not set yet