deactivate all resources first before sync, and fixing the tenant in api call
handle empty values