Fix script check database