Changed db opening