added functions, fixed EscapeString