fix issue #6 on github
fix issue #4 on github
fix issue #3 on github
fix issue #5 on github