reworked the way illegal characters in responses are handled