fixed issue #522