added db functions