fix issue #4, #9