bug fix in constructor