[IC] added sanity check to db function