fix issue #513