Added more db functionality