add advance function for wstring