corrects error message in constructor function