fixed bug described in issue #14