implement database checking