updated db functionality.