make compatible with 5.2
not functions tested yet though