fixing SQL strings