fix error with character comparison