fix issue #45 #39 #14 update