fixed #26,fixed #24, fixed #15, fixed #13