fix issue #4
fix issue #9