fix a bug for issue #122.