fix initialization code