fix issue #507