updated to properly support unicode