fix issue #13
fix issue #14 and #15