check database when it can't open