fix a bug for output