fixing db check