fix compatibility for 2.6 and lower version

fix issue #20