fix sql on IO delete