checks database