fix bug issue #18

Affection of refactoring...