fixes for escaping and special characters