added check to db