put initialize flag and enc in constructor