added logic to read sub domain and set tenant id