contructor pattern - bug fix - property of undefined

Just a simple fix, first pull request ever, please correct if something somewhere went terribly wrong :)