fixed issue #547