using db rather than xml file