add db functionality