Fix problem with sql escaping