fixes case issues with sql