Added db handling