fixed bug described in issue #54