Added db functions