fix issue #508