add db related functions