added db function