fixed bug in issue #4