add database functions