added db functionality
added db functionality