fixed bug in deleted column sql