Fix for delete by query