change wstring to string, redesign exceptions