fix issue #2, #3