fixing illegal character issues