Made the SQL calls escape safe.