connecting with every db read/write