fix bug with escape sequences