update db function to take arguments