Better escaping solution. Thanks @tandrewnichols.