correctly escape apostrophes