bug fix in the constructor