Fixed some null references issue in case when DB is not reachable