Fix a bug on data assignment