Establishing proper DB connection