Added correct handling of special characters