added more db functionality