added some db fns