added some functions to do database minipulation