error check the db