Attempt 3: trying to fix illegal char problem