fix issue #19 #27 #47