added some DB functionality