Added setCode in constructor