remove additional trailing ' in escape-string