added two db functions