removed hardcoded tenant_id
added variable checks