Added validation for the constructor parameter.