fixing a minor bug in character handling