this is ugly, but it fixes the issue with escaped backslash at the end of a single-quoted string