fixed issue #3: fix bug