fix issue #512