fix single quote escaping issue, better support for custom domains