fixed bug with character escaping