working on test db function