contructor pattern - bug fix - property of undefined