added check db function