bug in constructor