fix #39 , fix #40 , fix #41 , triple fix!