fix issue #395
fix issue #396