add db connection logic