fixed bug#8 in the pull request