adding db functionality