refes issue #13 fix a bug