remove trailing escapes