fix a bug for data convertion