invalid characters fix