changed some things for better utf8 compatibility