fixed wrong character handling