fixed issue with escaping apostrophes