fix a bug from issue #14