update db functions